package com.chujiekeji.test.fragment.friend;


import com.chujiekeji.test.adapter.BaseRecyclerAdapter;
import com.chujiekeji.test.adapter.friend.GuanZhuAdapter;
import com.chujiekeji.test.api.ChujieApi;
import com.chujiekeji.test.bean.PageBean;
import com.chujiekeji.test.bean.ResultBean;
import com.chujiekeji.test.bean.friend.GuanZhu;
import com.chujiekeji.test.fragment.base.BaseRecyclerViewFragment;
import com.chujiekeji.test.util.TLog;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;

public class GuanZhuFragment extends BaseRecyclerViewFragment<GuanZhu> {

	@Override
	protected BaseRecyclerAdapter<GuanZhu> getRecyclerAdapter() {
		return new GuanZhuAdapter(getContext(),BaseRecyclerAdapter.ONLY_FOOTER);
	}

	@Override
	protected Type getType() {
		return new TypeToken<ResultBean<PageBean<GuanZhu>>>() {
		}.getType();
	}
	@Override
	protected void requestData() {
		super.requestData();
		ChujieApi.fetchPengYou(isRefreshing ? 1 :(mBean.getNextPage()==null?1:mBean.getNextPage()),20,0,mHandler);
	}

}
